
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>游戏盒子 - 微信小程序app</title>
    


    <link rel="shortcut icon" href="favicon.ico">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/4.4.0/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    
    
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>微信小程序app
                        <small>微信小程序app添加</small>
                    </h5>
                    
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal">

                        <input type="hidden" name="id" value="{$data['app_info']['id']}">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">应用名称</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="title" value="{$data['app_info']['title']}" id="title">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">排序</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="sort" value="{$data['app_info']['sort']}" id="sort">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">应用的appid</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="appid" id="appid" value="{$data['app_info']['appid']}" >
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">应用的secret</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="secret" id="secret" value="{$data['app_info']['secret']}" >
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">应用url</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="url" id="url" value="{$data['app_info']['url']}">

                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">应用版本</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="envversion" id="envversion"  value="{$data['app_info']['envversion']}">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">描述</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="content" value="{$data['app_info']['content']}" id="content">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否显示</label>

                            <div class="col-sm-10">

                                <!---  中间是否显示：1显示，0不显示  -->
                                <select class="form-control m-b" name="isshow" id="isshow">
                                    <option value="0" <?php if( $data['app_info']['isshow'] == 0){ echo 'selected="selected"';}  ?>>不显示</option>
                                    <option value="1" <?php if( $data['app_info']['isshow'] == 1){ echo 'selected="selected"';}  ?>>显示</option>

                                </select>
                            </div>
                                
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">web模块</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="module" value="{$data['app_info']['module']}" id="module">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户表（数据表）</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="user_table" value="{$data['app_info']['user_table']}" id="user_table">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">模板消息表（formid的）</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="template_table" value="{$data['app_info']['template_table']}" id="template_table">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">模板id</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="template_id" value="{$data['app_info']['template_id']}" id="template_id">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">别名（小程序别名）</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="other_name" value="{$data['app_info']['other_name']}" id="other_name">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                       
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="button" onClick="save()">保存内容</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/Public/Admin/js/contabs.min.js?v=1.0"></script>
<script src="/Public/Admin/js/plugins/layer/layer.js?v=1.0"></script>
<script>
    
	var lock = 0;
	function save()
	{
		if(lock == 1){ return false;}

		var url = "{:U('App/edit')}";
		$.ajax({
				type : 'post',
				url  : url+'?t='+Math.random(),
                data : $("form").serialize(),
                dataType : 'json',
				beforeSend: function(){
					lock = 1;
				},
				success : function(res){
					layer.closeAll();
					if(res.state > 0){
					  layer.msg('修改成功', {icon: 1});
					  var t = window.setTimeout("reload()",2000); 
								
					}else{
						layer.msg(res.error, {icon: 2});
					}
				},
				complete: function(){
					lock = 0;
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					layer.closeAll();
					layer.msg('网络失败，请刷新页面后重试', {icon: 2});		
				}
		})		
	}
	
	
	function reload()
	{
		document.location.reload();//当前页面
	}
	
</script>

</body>

</html>
